// Animal父类  ->  Dog子类  
 class Animal {
     constructor(name) {
         this.name = name;
         this.thirst =100;
         this.belly = [];
     }
     drink() {
         this.thirst -= 10;
         return this;
     }
     eat(food) {
         this.belly.push(food);
         return this;
     }
 }

 class Dog extends Animal{
    constructor(name,breed) {
        super(name);
        this.breed = breed; // 子类有的
    }
    bark() {
        console.log('BARK BARK BARK!');
    }
 }

 const sunny = new Dog('sunny','Gold Doodle');
 console.log(sunny.name);
 sunny.eat('烤鱼').drink().eat('火锅').drink();
 console.log(sunny.thirst,sunny.belly);